<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>地址管理</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
">
<link rel="stylesheet" href="resources/css/weui.min.css">
<link rel="stylesheet" href="resources/css/jquery-weui.css">
<link rel="stylesheet" href="resources/css/style.css">
<link rel="stylesheet" href="resources/css/custom.css">
</head>
<body ontouchstart v-cloak>
<!--主体-->
<header class="wy-header">
  <div class="wy-header-icon-back"><span></span></div>
  <div class="wy-header-title">地址管理</div>
</header>
<div class="weui-content">
  <div class="weui-panel address-box">
    <div class="weui-panel__bd" v-for="(list,id) in contectList">
      <div class="weui-media-box weui-media-box_text address-list-box">
        <a @click="edit(list.id)" class="address-edit"></a>
        <h4 class="weui-media-box__title"><span>{{ list.name }}</span>&emsp;<span>{{ list.moblie }}</span></h4>
        <p class="weui-media-box__desc address-txt">{{ list.address }}</p>
        <span v-if="list.contactFlag == 1" class="default-add">默认地址</span>
      </div>
    </div>
    
  </div>
  <div class="weui-btn-area">
    <a class="weui-btn weui-btn_primary" href="addressAdd" id="showTooltips">添加收货地址</a>
  </div>
</div>




<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/fastclick.js"></script> 
<script src="resources/js/jquery-weui.min.js"></script>
<script src="resources/js/custom.js"></script>  
<!-- 引入vue -->
<!-- 生产环境版本，优化了尺寸和速度 -->
<!-- 
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
<script src="resources/js/vue@2.6.12"></script>
 -->
<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<!-- 
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
 -->
<script src="resources/js/vue.js"></script>
<script type="text/javascript">
    //vue管理
    new Vue({
        el:'.address-box',
        data:{
        	contectList:[]
        },
        methods:{
        	edit(id){
        	    Post('addressEdit',{id:id});
            }
        },
        // 组件挂载完毕
        mounted() {
                //获取地址列表
                $.post('api/v1/contect',{id:245},(result)=>{
        			this.contectList = result.contectList;
    			});
	            // 回退
	            $(".wy-header-icon-back").click(()=>{location.href="./";})
                $(function() {
                    // 显示
                    $("body").removeAttr("v-cloak");
                    // fastclick
                    FastClick.attach(document.body);
                });
        },
    });
</script>
</body>
</html>
